#version 450 core
#extension GL_ARB_explicit_uniform_location : require

layout(location = 0) in vec3 inPos;
layout(location = 1) in vec3 inNormal;
layout(location = 0) out vec3 normal;
layout(location = 1) out vec3 fragPos;

struct World {
    vec3 cameraPos;
    mat4 matVP;
};
layout(binding = 0, std140) uniform WorldBlock {
    World world;
};

struct Transform {
    mat4 modelMatrix; // 2
    mat4 mvpMatrix; // 3
    mat4 normalMatrix; // 4
};
layout(location = 2) uniform Transform transform;

void main() {
    gl_Position = transform.mvpMatrix * vec4(inPos, 1.0f);
    normal = inNormal; // vec3(transform.normalMatrix * vec4(inNormal, 1.0f));
    fragPos = inPos; // vec3(model * vec4(inPos, 1.0f))
}
